package com.cennavi.mineplay.mineplay_data.utils;

public class EventMsgTransfromTool {
	/**
	 * 将事件信息文字字符串转为10进制数
	 * @param 事件信息文字字符串
	 * @return
	 */
    public static int eventMsgTransform(String eventMsg){
    	if(eventMsg == null || eventMsg.equals("")){   		
    		return 0;
    	}
    	int msgCount=0;
    	if(eventMsg.contains("紧急") || eventMsg.contains("劫") ){
    		msgCount=msgCount+1;
    	}
    	if(eventMsg.contains("超速")){
    		msgCount=msgCount+2;
		}
    	if(eventMsg.contains("疲劳")){
			msgCount=msgCount+4;
		}
    	if(eventMsg.contains("危险")){
			msgCount=msgCount+8;
		}
    	if(eventMsg.contains("GNSS 模块")){
			msgCount=msgCount+16;
		}
    	if(eventMsg.contains("GNSS 天线未接")){
			msgCount=msgCount+32;		
		}
    	if(eventMsg.contains("GNSS 天线短路")){
			msgCount=msgCount+64;
		}
    	if(eventMsg.contains("欠压")){
			msgCount=msgCount+128;
		}
    	if(eventMsg.contains("掉电")){
			msgCount=msgCount+256;
		}
    	if(eventMsg.contains("LCD")){
			msgCount=msgCount+512;
		}
    	if(eventMsg.contains("TTS")){
			msgCount=msgCount+1024;
		}
    	if(eventMsg.contains("摄像头") || eventMsg.contains("视频")){
			msgCount=msgCount+2048;
		}
    	if(eventMsg.contains("IC")){
			msgCount=msgCount+4096;
		}
    	if(eventMsg.contains("累计")){
			msgCount=msgCount+262144;	
		}
    	if(eventMsg.contains("停车")){
			msgCount=msgCount+524288;
		}
    	if(eventMsg.contains("区域")){
			msgCount=msgCount+1048576;	
		}
    	if(eventMsg.contains("路线")){
			msgCount=msgCount+2097152;
		}
    	if(eventMsg.contains("路段")){
			msgCount=msgCount+4194304;	
		}
    	if(eventMsg.contains("偏离")){
			msgCount=msgCount+8388608;
		}
    	if(eventMsg.contains("VSS")){
			msgCount=msgCount+16777216;	
		}
    	if(eventMsg.contains("油量")){
			msgCount=msgCount+33554432;
		}
    	if(eventMsg.contains("盗")){
			msgCount=msgCount+67108864;	
		}
    	if(eventMsg.contains("点火")){
			msgCount=msgCount+134217728;
		}
    	if(eventMsg.contains("位移")){
			msgCount=msgCount+268435456;	
		}
    	if(eventMsg.contains("碰撞")){
			msgCount=msgCount+536870912;
		}
    	if(eventMsg.contains("侧翻")){
			msgCount=msgCount+1073741824;
		}
    	if(eventMsg.contains("非法开门")){
//			msgCount=msgCount+2147483648;
		}
    	//System.out.println(msgCount);
    	return msgCount;
    }
//	public static void main(String[] args) {
// 		EventMsgTransfromTool.eventMsgTransform("超速,疲劳");
//	}
}
